<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增订货单记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-dh-add">
        <input type="hidden" name="pId" th:value="${wmsProduct.pId}">

        <div class="form-group">
            <label class="col-sm-3 control-label">选择订货单：</label>
            <div class="col-sm-8">
                <select class="form-control" name="purId">
                    <option selected="selected" value="">请选择订单</option>
                    <option th:each="wmsPurchase:${wmsPurchases}" th:value="${wmsPurchase.purId}" th:text="${wmsPurchase.purId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品：</label>
            <div class="col-sm-8">
                <input name="pName" class="form-control" th:value="${wmsProduct.pName}" type="text" disabled="disabled" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品描述：</label>
            <div class="col-sm-8">
                <input name="pDesc" class="form-control" th:value="${wmsProduct.pDesc}" type="text" disabled="disabled" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">订货数量：</label>
            <div class="col-sm-8">
                <input name="detPurPCount" class="form-control" type="text" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    var prefix = ctx + "essentials/purchase"
    $("#form-dh-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/addProduct", $('#form-dh-add').serialize());
        }
    }
</script>
</body>
</html>